﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;
using System.Security.Cryptography;

namespace IronSharePoint
{
    public class FarmFeatureReceiver : SPFeatureReceiver
    {
        public override void FeatureActivated(SPFeatureReceiverProperties properties)
        {
            IronSettings settings = SPFarm.Local.GetObject(IronConstant.StoreId) as IronSettings;

            if (settings == null)
            {
                settings = new IronSettings("IronStore", SPFarm.Local, IronConstant.StoreId);
                settings.CreateNewPrivateKey();

                settings.Update();
                settings.Provision();
            }
        }

        public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
        {
            
        }

        public override void FeatureInstalled(SPFeatureReceiverProperties properties)
        {
           
        }

        public override void FeatureUninstalling(SPFeatureReceiverProperties properties)
        {
            
        }
    }
}
